package ru.ifmo.ipimenov.ewf_svn.standalone.model;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.RulesDao;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.impl.RulesDaoHibernate;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.Document;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.Rules;

import java.util.List;

/**
 * @author: Ilya Pimenov
 * Scartel Starlab company
 */
public class RulesProvider {
    /**
     * Logger for all purposes
     */
    private static Log log = LogFactory.getLog(CategoryProvider.class);

    private static RulesProvider instance = new RulesProvider();

    private RulesDao dao = new RulesDaoHibernate();

    public static RulesProvider getInstance() {
        return instance;
    }

    public List<Rules> load(Document document) {
        return dao.list(document);
    }

}